﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Tryit.Converter
{
    public class HeightMultiplierConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
           if (value is double originalHeight && parameter is string multiplierStr &&
            double.TryParse(multiplierStr, out double multiplier))
        {
            return originalHeight * multiplier; // 返回乘以的高度
        }
        return value; // 如果没有有效的值就返回原始值
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
